﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System.Net.Mail;

namespace DNA.Mvc.Notification
{
    /// <summary>
    /// Present the email subscription sender class
    /// </summary>
    public class SimpleEmailSubscriptionSender : MailSubscriptionSender
    {        
        /// <summary>
        /// Get/Sets the text on the top of the email body.
        /// </summary>
        public virtual string BodyHeader { get; set; }

        /// <summary>
        /// Gets/Sets the text on the bottom of the email footer.
        /// </summary>
        public virtual string BodyFooter { get; set; }

        protected override void OnPopuplateMailMessage(MailMessage message)
        {
            if (!string.IsNullOrEmpty(BodyHeader))
                message.Body += BodyHeader + "\r\n";

            if (!string.IsNullOrEmpty(BodyFooter))
                message.Body += "\r\n" + BodyFooter;
        }
    }


}
